<!DOCTYPE html>
<html>	
	<head>
		<!-- css3 formazasok a kinezethez -->
		<link href="Design.css" rel="stylesheet" type="text/css">
		<script type="text/javascript">
			function errorfind(){
				var tmp = decodeURI(<!--atvesszuk az uzenetkodot amihez tartozo uzenetet toroljuk-->
					(RegExp("succes" + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
				);
				if (tmp == "true")
					alert("Activity delete successfully!");
				if (tmp == "false")
					alert("Start date need to be equal or greater than end date!");
			}
				<?php
					//activityhoursclass az aktivitasok lekerdezesehez szukseges
					include "classes.php";
					session_start();
					$username=$_SESSION['username'];
					$year = wordwrap($_GET['year']);
					$month = wordwrap($_GET['month']);
					$day = wordwrap($_GET['day']);
				?>
				<!--atvesszunk az adatbazisbol listakat amelyet kilistazunk egy valaszthato listaba-->
			var activityhourlist = [<?php $ahclass = new activityhours;
										  $ahclass -> set_username($username);
										  $ahclass->getactivityhourlistdb("$year-$month-$day 00:00:00","$year-$month-$day 23:59:59",$tmp1,$tmp2); if ($month<10) $month="0$month"; if ($day<10) $day="0$day";
										  echo "$tmp1";?>];
			var activityhourlistID = [<?php echo "$tmp2"; ?>];							  
			function populateList() {
				var proLen=activityhourlist.length;
				for(var i=0; i<proLen; i++){<!--feltoltunk egy valaszthato listat es megjelenitjuk-->
					document.activityprojects.project.options[i]=new Option(activityhourlist[i],activityhourlistID[i]);
				}
				errorfind();
			}
			window.onload=populateList;
		</script>
	</head>
<body>
<div id="userpopup">
<!--a kilistazott activityk kozul torolhetunk valaszthato intervallumbol-->
<!--a bejelentkezo felhasznalo aktivitasait-->
	<div id="Subtitle">Delete Activity</div>
	<form action="BLL.php" name="activityprojects">
		<br>Select Activity:<br>
			<select name="project">
			</select><br>
		<br>Delete similary projekt-activity in this duration:<br><input type="date" name="startdate" value="<?php echo "$year-$month-$day";?>"/>-<input type="date" name="enddate" value="<?php echo "$year-$month-$day";?>"/><br>
		<br><input type="submit" name="deleteactivityhour" value="Delete!" id="button"\>
	</form>
</div>
</body>